﻿using System;
using System.Runtime.InteropServices;
using ScenarioFramework.WorkflowEngine.DataModel.WorkflowProcesses;
using ScenarioFramework.WorkflowEngine.DataModel.WorkflowRelevantData;

namespace ScenarioFramework.WAPI
{
    public partial class Activity
    {
        /// <summary>
        /// Sets the activity attributes.
        /// </summary>
        /// <param name="xmlActivity">The XML activity.</param>
        /// <param name="xmlAttributes">The XML attributes.</param>
        /// <param name="sUser">The s user.</param>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "setActivityAttributes")]
        private static extern String SetActivityAttributes(String xmlActivity, String xmlAttributes, string sUser, ref Response response);

        /// <summary>
        /// Gets the activity attributes.
        /// </summary>
        /// <param name="xmlActivity">The XML activity.</param>
        /// <param name="sOwner">The s owner.</param>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "getActivityAttributes")]
        private static extern String GetActivityAttributes(String xmlActivity, String sOwner, ref Response response);

        /// <summary>
        /// Gets the attributes.
        /// </summary>
        /// <param name="sActivityName">Name of the s activity.</param>
        /// <param name="response">The response.</param>
        /// <param name="lProcessID">The l process ID.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "getAttributesFromActivity")]
        private static extern String GetAttributes(String sActivityName, ref Response response, long lProcessID);

        /// <summary>
        /// Gets the activity list.
        /// </summary>
        /// <param name="sUser">The s user.</param>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "getActivityList")]
        private static extern String GetActivityList(String sUser, ref Response response);

        /// <summary>
        /// Gets all activity list.
        /// </summary>
        /// <param name="sUser">The s user.</param>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "getAllActivityList")]
        private static extern String GetAllActivityList(String sUser, ref Response response);

        /// <summary>
        /// Gets all activity list.
        /// </summary>
        /// <param name="sUser">The s user.</param>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "getAllMyActivityList")]
        private static extern String GetAllMyActivityList(String sUser, ref Response response);

        /// <summary>
        /// Gets the activity list by process.
        /// </summary>
        /// <param name="response">The response.</param>
        /// <param name="sUser">The s user.</param>
        /// <param name="lProcessId">The l process id.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "getActivityListByProcess")]
        private static extern String GetActivityListByProcess(ref Response response, String sUser, long lProcessId);

        /// <summary>
        /// Gets the activities by process.
        /// </summary>
        /// <param name="response">The response.</param>
        /// <param name="lProcessId">The l process id.</param>
        /// <returns></returns>
        [DllImport("WAPI.Dll", EntryPoint = "getActivitiesByProcess")]
        private static extern String GetActivitiesByProcess(ref Response response, long lProcessId);

        /// <summary>
        /// Acquires the activity.
        /// </summary>
        /// <param name="xmlActivity">The XML activity.</param>
        /// <param name="sOwner">The s owner.</param>
        /// <param name="response">The response.</param>
        [DllImport("WAPI.dll", EntryPoint = "acquireActivity")]
        private static extern void AcquireActivity(String xmlActivity, String sOwner, ref Response response);

        /// <summary>
        /// Assigns the activity.
        /// </summary>
        /// <param name="xmlActivity">The XML activity.</param>
        /// <param name="sOwner">The s owner.</param>
        /// <param name="response">The response.</param>
        [DllImport("WAPI.dll", EntryPoint = "assignActivity")]
        private static extern void AssignActivity(String xmlActivity, String sOwner, ref Response response);

        /// <summary>
        /// Gets the activity log.
        /// </summary>
        /// <param name="xmlActivity">The XML activity.</param>
        /// <param name="sOwner">The s owner.</param>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.dll", EntryPoint = "getActivityLog")]
        private static extern String GetActivityLog(String xmlActivity, String sOwner, ref Response response);

        /// <summary>
        /// Gets the activity history log.
        /// </summary>
        /// <param name="xmlActivity">The XML activity.</param>
        /// <param name="sOwner">The s owner.</param>
        /// <param name="response">The response.</param>
        /// <returns></returns>
        [DllImport("WAPI.dll", EntryPoint = "getActivityHistoryLog")]
        private static extern String GetActivityHistoryLog(String xmlActivity, String sOwner, ref Response response);
    }
}
